
import { withRouter } from 'react-router';
import { Component } from 'refast';
import logic from './logic';
import './PageHeatmap.less';
import Heats from 'components/heatmaps';
let Tabs = require('uxcore-tabs');
let TabPane = Tabs.TabPane;

class PageHeatmap extends Component {

  constructor(props) {
    super(props, logic);
    let date = new Date();
    this.state = {
      city: this.props.city || "杭州市",
      time: date
    }
  }


  render() {
    const { state: { city, time } } = this;
    return (
      <div className="page-heatmap">
        {/* <Tabs defaultActiveKey="1" type="open">
          <TabPane tab="实时分析" key="1"> */}
        <Heats name="maplet" type={'current'} city={city} time={time} />
        {/* </TabPane>
          <TabPane tab="同期对比" key="2">
             <Heats name="maplet_2" type={'constract'} city={city} year={year} month={month} day={day} hour={hour} min={min} sec={sec} />
            <Heats name="maplet_3" type={'constract'} city={city} year={year} month={month} day={day} hour={hour} min={min} sec={sec} /> 
          </TabPane> 
        </Tabs>*/}

      </div>
    );
  }
  componentWillReceiveProps(nextProps) {
    let t = this,
      { state: { city } } = t;
    if (nextProps.city != city) t.setState({ city: nextProps.city });
  }
}

export default withRouter(PageHeatmap);
